package com.cssw.fyzb.wap.service;

import com.cssw.fyzb.base.web.domain.AjaxData;
import com.cssw.fyzb.wap.model.vo.ParseWordVo;
import com.cssw.fyzb.wap.model.vo.ShareWordVo;
import com.ydn.appserver.MinaAppClient;
import com.ydn.appserver.Request;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author YangYiQun
 */
@Service
public class WordCmdService extends BaseService {

    @Autowired
    private MinaAppClient busiClient;

    public AjaxData<ShareWordVo> shareVideoWord(Long userId, Long videoId, String type) {
        Request request = new Request("ShareVideoWord");
        request.setParameter("userId", userId);
        request.setParameter("videoId", videoId);
        request.setParameter("type", type);
        return convertData(busiClient.send(request), ShareWordVo.class);
    }



    /**
     * 分享直播
     * @param userId
     * @param liveId
     * @param type
     * @return
     */
    public AjaxData<ShareWordVo> shareLiveWord(Long userId, Long liveId, String type) {
        Request request = new Request("ShareLiveWord");
        request.setParameter("userId", userId);
        request.setParameter("liveId", liveId);
        request.setParameter("type", type);
        return convertData(busiClient.send(request), ShareWordVo.class);
    }

    public AjaxData<ParseWordVo> parseWordCmd(Long userId, String content) {
        Request request = new Request("ParseWordCmd");
        request.setParameter("userId", userId);
        request.setParameter("content", content);
        return convertData(busiClient.send(request), ParseWordVo.class);
    }
}
